/*
 * @Author: Jiraiya
 * @Date: 2020-05-26 16:53:34
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-05-29 10:52:01
 * @Description: 
 */ 
export default function compose(...funcs){
    if(funcs.length === 0){
        return arg => arg;
    }

    if(funcs.length === 1){
        return funcs[0];
    }

    return funcs.reduce((a, b)=> (...args)=> a(b(args)))
}


const f1 = (a)=>{
    return a;
}
const f2 = (b)=>{
    return 1;
}